
#ifndef _RADIX_ENGINE_IMPL_PARTICLE_H_
#define _RADIX_ENGINE_IMPL_PARTICLE_H_

#include <Engine/Particle.h>

_BeginNamespace(Radix)

/*
=================================================================
== Particle
=================================================================
*/
class Particle :public IParticle
{
public:
	Particle();
	virtual ~Particle();

public:
	virtual bool alive();
	virtual void alive(bool value);
	virtual const Vector3& position();
	virtual void position(const Vector3& pos);
	virtual const Vector3& velocity();
	virtual void velocity(const Vector3& vel);
	virtual const Vector3& acceler();
	virtual void acceler(const Vector3& acc);
	virtual const Color& color();
	virtual void color(const Color& col);
	virtual const String& texture();
	virtual void texture(const String& tex);

private:
	bool mAlive;
	Vector3 mPosition;
	Vector3 mVelocity;
	Vector3 mAcceler;
	Color mColor;
	String mTexture;
};
/*
=================================================================
== ParticleEmiter
=================================================================
*/
class ParticleEmiter :public IParticleEmiter
{
public:
	virtual void emit(IParticle* particle) = 0;
};
/*
=================================================================
== ParticleAffector
=================================================================
*/
class ParticleAffector :public IParticleAffector
{
public:
	virtual void affect(IParticle* particle) = 0;
};
/*
=================================================================
== ParticleTemplate
=================================================================
*/
class ParticleTemplate :public IParticleTemplate
{
public:
	ParticleTemplate(const String& name);
	virtual ~ParticleTemplate();

public:
	virtual IParticleEmiter* createEmiter(const String& name);
	virtual IParticleEmiter* selectEmiter(const String& name);
	virtual void deleteEmiter(const String& name);
	virtual void deleteEmiters();

	virtual IParticleAffector* createAffector(const String& name);
	virtual IParticleAffector* selectAffector(const String& name);
	virtual void deleteAffector(const String& name);
	virtual void deleteAffectors();
};
/*
=================================================================
== ParticleCluster
=================================================================
*/
class ParticleCluster :public IParticleCluster
{
public:
	ParticleCluster(const String& name);
	virtual ~ParticleCluster();

public:
	virtual const Vector3& position();
	virtual void position(const Vector3& pos);
	virtual const Vector4& orientation();
	virtual void orientation(const Vector4& ori);
};
/*
=================================================================
== ParticleSystem
=================================================================
*/
class ParticleSystem :public IParticleSystem
{
public:
	ParticleSystem();
	virtual ~ParticleSystem();

public:
	virtual IParticleTemplate* createTemplate(const String& name);
	virtual IParticleTemplate* selectTemplate(const String& name);
	virtual void deleteTemplate(const String& name);
	virtual void deleteTemplates();

	virtual IParticleCluster* createCluster(const String& name);
	virtual IParticleCluster* selectCluster(const String& name);
	virtual void deleteCluster(const String& name);
	virtual void deleteClusters();

private:
	Table<String, IParticleTemplate> mTemplates;
	Table<String, IParticleCluster> mClusters;
};

_EndNamespace(Radix)

#endif//_RADIX_ENGINE_IMPL_PARTICLE_H_
